package com.cskaoyan.mapper;

import com.cskaoyan.bean.vo.AdminOrderUserInDetailVO;
import com.cskaoyan.bean.MarketUser;
import com.cskaoyan.bean.MarketUserExample;
import com.cskaoyan.bean.vo.statistics.UserRowsVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketUserMapper {
    long countByExample(MarketUserExample example);

    int deleteByExample(MarketUserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketUser record);

    int insertSelective(MarketUser record);

    List<MarketUser> selectByExample(MarketUserExample example);

    MarketUser selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketUser record, @Param("example") MarketUserExample example);

    int updateByExample(@Param("record") MarketUser record, @Param("example") MarketUserExample example);

    int updateByPrimaryKeySelective(MarketUser record);

    int updateByPrimaryKey(MarketUser record);

    //用户统计，显示用户增长数量，最后登录日期。
    List<UserRowsVo> selectCountGroupByTime();

    // // 从market_user表格中查找nickname、avatar（前端就需要这两个）
    AdminOrderUserInDetailVO selectUser(Integer userId);

    void insertCode(@Param("phoneNumber") String phoneNumber, @Param("code") String code);

    String selectCodeByPhone(String mobile);

    void deleteCodeByPhoneNumber(String phoneNumber);
}